package com.dfec.water.dashboard.controller;

import com.dfec.common.utils.AjaxResult;
import com.dfec.water.entity.YdbApplyInfoEntity;
import com.dfec.water.entity.YdbAreaBaseInfoEntity;
import com.dfec.water.service.YdbApplyInfoService;
import com.dfec.water.service.YdbAreaBaseInfoService;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;
import java.util.List;

/**
 * 大屏-首页
 * @author tangrg
 * @email 1446232546@qq.com
 * @date 2025-02-2025/2/26 11:23:37
 */
@Tag(name = "大屏-首页")
@RestController
@RequestMapping("dashboard/home")
public class HomeController {

    @Resource
    private YdbAreaBaseInfoService ydbAreaBaseInfoService;


    @Resource
    private YdbApplyInfoService ydbApplyInfoService;

    /**
     * 项目列表
     */
    @PostMapping("/statAllAreaInfo")
    @Operation(summary = "项目列表")
    public AjaxResult<List<YdbAreaBaseInfoEntity>> listAll(@RequestBody YdbAreaBaseInfoEntity ydbAreaBaseInfo) {
        return AjaxResult.ok().put(ydbAreaBaseInfoService.listAll(ydbAreaBaseInfo));
    }

    /**
     * 事件统计
     */
    @GetMapping("/statDealData")
    @Operation(summary = "事件统计")
    public AjaxResult<List<YdbApplyInfoEntity>> statDealData() {
        return AjaxResult.ok().put(ydbApplyInfoService.statDealData());
    }



    /**
     * 事件列表
     */
    @PostMapping("/statApplyInfo")
    @Operation(summary = "事件列表")
    public AjaxResult<List<YdbApplyInfoEntity>> listAll(@RequestBody YdbApplyInfoEntity ydbApplyInfo) {
        return AjaxResult.ok().put(ydbApplyInfoService.listAll(ydbApplyInfo));
    }

}
